package com.ruoyi.mateproduction.service.impl;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.mateproduction.domain.MateHandover;
import com.ruoyi.mateproduction.domain.MateHandoverModel;
import com.ruoyi.mateproduction.domain.UnqualifiedReview;
import com.ruoyi.mateproduction.domain.UnqualifiedReviewModel;
import com.ruoyi.mateproduction.mapper.MateAsepsisMapper;
import com.ruoyi.mateproduction.service.MateAsepsisService;
import com.ruoyi.operateTraining.domain.TrainingSignModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author
 * @Version 1.0
 */
@Service
public class MateAsepsisServiceImpl implements MateAsepsisService {
    @Autowired
    private MateAsepsisMapper mateAsepsisMapper;

    @Override
    public int addMateHandover(MateHandover mateHandover) {
        int a = mateAsepsisMapper.addMateHandover(mateHandover);
        if (mateHandover.getMateHandoverModels().size() != 0) {
            for (MateHandoverModel mateHandoverModel : mateHandover.getMateHandoverModels()) {
                mateHandoverModel.setHandoverId(mateHandover.getHandoverId());
                mateAsepsisMapper.addMateHandoverModel(mateHandoverModel);
            }
        } else {
        }
        return a;
    }

    @Override
    public int addUnqualifiedReview(UnqualifiedReview unqualifiedReview) {
        int a = mateAsepsisMapper.addUnqualifiedReview(unqualifiedReview);
        if (unqualifiedReview.getReviewModels().size() != 0) {
            for (UnqualifiedReviewModel unqualifiedReviewModel:unqualifiedReview.getReviewModels()){
                unqualifiedReviewModel.setReviewId(unqualifiedReview.getReviewId());
                mateAsepsisMapper.addUnqualifiedReviewModel(unqualifiedReviewModel);
            }
        }
        return a;
    }
}
